package sword.T24;

import util.ListNode;

/**
 * @File Info: leetcode -- <Solution>
 * @Author: 18362
 * @Create: 2022-03-28 0:24:46 星期一
 */

class Solution {
    public ListNode reverseList(ListNode head) {
        if (head == null || head.next == null)
            return head;
        ListNode tHead = reverseList(head.next);
        head.next.next = head;
        head.next = null;
        return tHead;
    }
}